package com.project.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.framework.core.result.BasePage;
import com.project.entity.CmsOrder;
import com.project.pojo.dto.GetOrderNumDTO;
import com.project.pojo.dto.ProductOrderListDTO;
import com.project.pojo.model.GetOrderListModel;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface CmsOrderMapper extends BaseMapper<CmsOrder> {

    /**
     * 获取订单列表
     * @param page 分页参数
     * @param getOrderListModel
     * @return
     */
    IPage<ProductOrderListDTO> getOrderList(Page<ProductOrderListDTO> page, @Param("getOrderListModel") GetOrderListModel getOrderListModel);

    /**
     * 按条件查询订单列表
     * @param getOrderListModel
     * @return
     */
    List<ProductOrderListDTO> getOrderList(@Param("getOrderListModel") GetOrderListModel getOrderListModel);

    /**
     * 查询超过24小时待付款的商品订单
     * @return
     */
    List<CmsOrder> selectToBePaidOrder();

    /**
     * 查询未确认收货的订单
     * @return
     */
    List<CmsOrder> selectConfirmReceiptOrder();

    /**
     * 查询确认收货多少天后未评价的商品订单
     */
    List<CmsOrder> selectToBeEvaluatedOrder(@Param("addDay") Integer addDay);

    /**
     * 获取用户商品订单、回收订单各状态数量
     * @param userId
     * @return
     */
    GetOrderNumDTO getUserProductOrderNum(@Param("userId") Long userId);
}